import { NgModule, SkipSelf, Optional } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { BrowserModule } from '@angular/platform-browser';
import { HeaderComponent } from './layouts/header/header.component';
import { InputTreeComponent } from './components/input-tree/input-tree.component';
import { FormsModule } from '@angular/forms';
import { OtherComponent } from './components/other/other.component';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { UploadComponent } from './components/upload/upload.component';
import { NzUploadModule } from 'ng-zorro-antd/upload';
import { NzMessageModule } from 'ng-zorro-antd/message';
import { ProcessComponent } from './components/process/process.component';
import { NzAlertModule } from 'ng-zorro-antd/alert';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { AuditAlertComponent } from './components/audit-alert/audit-alert.component';
import { FuzzySearchComponent } from './components/fuzzy-search/fuzzy-search.component';

@NgModule({
  declarations: [
    HeaderComponent,
    InputTreeComponent,
    OtherComponent,
    UploadComponent,
    ProcessComponent,
    AuditAlertComponent,
    FuzzySearchComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    NzSelectModule,
    NzTreeModule,
    NzUploadModule,
    NzMessageModule,
    NzAlertModule,
    NzIconModule
  ],
  providers: [],
  exports: [
    HeaderComponent,
    BrowserModule,
    AppRoutingModule,
    InputTreeComponent,
    OtherComponent,
    FormsModule,
    UploadComponent,
    NzUploadModule,
    NzMessageModule,
    ProcessComponent,
    AuditAlertComponent,
    FuzzySearchComponent,
    NzAlertModule,
    NzIconModule
  ],
})
export class CoreModule {
  constructor(@SkipSelf() @Optional() parentModule: CoreModule) {
    if (parentModule) {
      throw new Error('CoreModule只能被AppModule引入');
    }
  }
}
